package com.jjb.www.utils;


import com.jjb.www.app.AppApplication;

/**
 * Author: lkw
 * time:   2021/9/13 10:18
 * des:    Dp转PX
 */
public class DpUtil {
    private static float scale;

    static {
        scale = AppApplication.sInstance.getResources().getDisplayMetrics().density;
    }

    public static int dp2px(int dpVal) {
        return (int) (scale * dpVal + 0.5f);
    }
}
